﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;


namespace ExameRegister
{
    public partial class PublicOfficialSelectionWindow : ChildWindow
    {
        private ServiceUtility su = new ServiceUtility();
        public PublicOfficialSelectionWindow(int ID)
        {
            InitializeComponent();
            su.OnCompletedCallService += new EventHandler<WCFEvent>(su_OnCompletedCallService);
            su.CallService("ExameRegister.BO.LoginBO", "GetPublicOfficialSelection", new object[1] { "p.ID = " + ID }, this);
        }

        void su_OnCompletedCallService(object sender, WCFEvent e)
        {
            var mode = Utility.ConvertFromJson<ObservableCollection<ExameRegister.Model.PublicOfficialSelection>>(e.Result).FirstOrDefault();
            if (mode != null)
            {
                this.DataContext = mode;
                //if (mode.FaBuType == "选调交流")
                //{
                //    xdjl.IsChecked = true;
                //}
                //else
                //{
                //    jzxxb.IsChecked = true;
                //}
            }
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }

       

        
    }
}
